<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'redsocial-grid',
    'type' => 'striped bordered hover advance',
    'dataProvider' => $model->search(),
    'columns' => array(
        array(
            'header' => 'Dirección',
            'name' => 'valor',
            'type' => 'raw',
        ),
        'tipo',
        array(
            'name' => 'principal',
            'value' => '$data->principal==1?"<i class=\"icon-check\"></i>":""',
            'type' => 'raw',
        ),
        array(
            'class' => 'CButtonColumn',
            'template' => '{update} {delete}',
            'buttons' => array(
                'update' => array(
                    'label' => '<button class="btn btn-primary"><i class="icon-pencil"></i></button>',
                    'options' => array('title' => 'Actualizar'),
                    'imageUrl' => false,
                    'url' => '$data->id',
                    'click' => 'function() {formModalRedSocial(true, $(this).attr("href")); return false;}',
                    'visible' => 'Util::checkAccess(array("action_redSocial_quickUpdate"))',
                ),
                'delete' => array(
                    'label' => '<button class="btn btn-danger"><i class="icon-trash"></i></button>',
                    'options' => array('title' => 'Eliminar'),
                    'url' => 'Yii::app()->createUrl("crm/redSocial/delete", array("id"=>$data->id))',
                    'imageUrl' => false,
                    'visible' => 'Util::checkAccess(array("action_redSocial_delete"))',
                ),
            ),
            'htmlOptions' => array(
                'width' => '80px'
            )
        ),
    ),
));
